<link href="images/skin.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #EEF2FB;
}
.error{color:red;}
-->
</style>

<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.form.js"></script>
<script type="text/javascript" src="js/jquery.validate.js"></script>
<script charset="utf-8" src="kindeditor-4.0.2/kindeditor.js"></script>

<script> 
$(document).ready(function(){	
	var editor1,editor2;
	KindEditor.ready(function(K) {
		K('select[name=charset1]').change(function() {
			if (editor1) {
				editor1.remove();
				editor1 = null;
			}
			editor1 = K.create('textarea[name="adv_desc"]', {
				langType : this.value
			});
		});
		K('select[name=charset1]').change();
		K('select[name=charset2]').change(function() {
			if (editor2) {
				editor2.remove();
				editor2 = null;
			}
			editor1 = K.create('textarea[name="adv_desc_en"]', {
				langType : this.value
			});
		});
		K('select[name=charset2]').change();
	}); 			  
	$("#domain").validate({
		rules:{
			   position_id:"required",
			   adv_link:"required"
			  }
		,
		messages:{
			position_id:"Please choose position.",
			adv_link:"Please input image link."
		},
		errorPlacement:function(error,element){
		error.appendTo(element.parent().parent().next().empty());
	   }
	});
});

</script>

<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="17" valign="top" background="images/mail_leftbg.gif"><img src="images/left-top-right.gif" width="17" height="29" /></td>
    <td valign="top" background="images/content-bg.gif"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
      <tr>
        <td height="31"><div class="titlebt">Add Image<span style="padding-left:160px;"><a href="adv_list.php">Image List</a></span></div></td>
      </tr>
    </table></td>
    <td width="16" valign="top" background="images/mail_rightbg.gif"><img src="images/nav-right-bg.gif" width="16" height="29" /></td>
  </tr>
  
  <tr>
    <td valign="middle" background="images/mail_leftbg.gif">&nbsp;</td>
    <td valign="top" bgcolor="#F7F8F9">
    <form id="domain" enctype="multipart/form-data" action="adv_add.php?act=<{if $id==""}>add<{else}>edit<{/if}>" method="post" ><input type="hidden" name="id" value="<{$id}>">
     <table width="100%" border="0" cellspacing="0" cellpadding="0" >
	 <br>
     <tr  class="nowtable">
     <td class="left_bt2" style="padding-left:10px;" colspan="2">Add Image</td>
     </tr>	
      <tr>
     <td width="32%" height="40px" bgcolor="#f2f2f2" class="left_txt" style="padding-left:20px;" align="left">
   Please choose position：<span style="padding-left:40px;"><select name="position_id"><option value="">Please choose position</option>
    <{if $id==""}><{foreach item=loop from=$advcat}><option value="<{$loop.id}>"><{$loop.position_name}></option><{/foreach}><{else}><{$show}><{/if}></select><font style="padding-left:5px; size:auto" color="#FF0000">*</font>
    </span>
     </td>
     <td  bgcolor="#f2f2f2" class="left_txt"></td>
     </tr>
     <tr>
     <td width="32%" height="40px" bgcolor="#f2f2f2" class="left_txt" style="padding-left:20px;" align="left" colspan="2">
    Image Title：(english)<span style="padding-left:50px;"><span class="left_txt" >
    <input style="width:160px;" type="text" name="adv_name" value="<{$list.adv_name}>">
    </span><font style="padding-left:5px; size:auto" color="#FF0000">*</font></span>   
     </td>    
     </tr>
     <tr>
     <td width="32%" height="40px" bgcolor="#f2f2f2" class="left_txt" style="padding-left:20px;" align="left" colspan="2">Words Format：<span style="padding-left:40px;"><select name="charset1">
					<option value="en" selected>English</option>
					<option value="zh_CN" >简体中文</option>
				</select></span> </td>
     </tr>
     <tr>
     <td width="32%" height="40px" bgcolor="#f2f2f2" class="left_txt" style="padding-left:20px;" align="left" colspan="2">
    <span style="vertical-align:top">Description：(english)</span><span style="padding-left:50px;"> <textarea name="adv_desc" id="adv_desc" style="width:700px;height:300px;"><{$list.adv_desc}></textarea><font style="padding-left:5px; size:auto" color="#FF0000">*</font></span>
     </td>
     </tr>
     <tr>
      <td   height="40px" bgcolor="#f2f2f2" class="left_txt" style="padding-left:20px;" align="left" colspan="2"> Image Title：(chinese)<span > <input style="width:160px;" type="text" name="adv_name_en" id="adv_desc_en" value="<{$list.adv_name_en}>"><font style="padding-left:5px; size:auto" color="#FF0000">*</font></span></td>
      </tr>
      <tr>
     <td width="32%" height="40px" bgcolor="#f2f2f2" class="left_txt" style="padding-left:20px;" align="left" colspan="2">Words Format：<span style="padding-left:40px;"><select name="charset2">
					<option value="en" >English</option>
					<option value="zh_CN" selected>简体中文</option>
				</select></span> </td>
     </tr>
     <tr>
     <td  b height="40px" bgcolor="#f2f2f2" class="left_txt" style="padding-left:20px;" align="left" colspan="2"> <span style="vertical-align:top">Description：(chinese)</span><span style="padding-left:50px;"> <textarea   name="adv_desc_en" style="width:700px;height:300px;"><{$list.adv_desc_en}></textarea><font style="padding-left:5px; size:auto" color="#FF0000">*</font></span></td>
     </tr>
     <tr>
     <td width="32%" height="40px" bgcolor="#f2f2f2" class="left_txt" style="padding-left:20px;" align="left">
     Image Link：<span style="padding-left:50px;"> <input style="width:160px;" type="text" name="adv_link" value="<{$list.adv_link}>"><font style="padding-left:5px; size:auto" color="#FF0000">*</font></span>
     </td>
     <td  bgcolor="#f2f2f2" class="left_txt"></td>
     </tr>
     <tr>
     <td colspan="2" width="32%" height="40px" bgcolor="#f2f2f2" class="left_txt" style="padding-left:20px;" align="left">
     Upload Image：<span style="padding-left:50px;"> <input type="file" value="" name="fileDoc">&nbsp;<{if $id!=""}><img width="80px" height="29px" src="<{$list.content}>" border=0 ><{/if}> </span>
     </td>
     </tr>
  

     <tr><td align="left" height="50px"  style="padding-left:200px"><input type="submit" name="submit" id="submit" value="Submit"></td></tr>
     </table>
  </form>
    </td>
    <td background="images/mail_rightbg.gif">&nbsp;</td>
  </tr>
  <tr>
    <td valign="bottom" background="images/mail_leftbg.gif"><img src="images/buttom_left2.gif" width="17" height="17" /></td>
    <td background="images/buttom_bgs.gif"><img src="images/buttom_bgs.gif" width="17" height="17"></td>
    <td valign="bottom" background="images/mail_rightbg.gif"><img src="images/buttom_right2.gif" width="16" height="17" /></td>
  </tr>
</table>
</body>
